﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SqlOrm.Models
{
    public class PrimaryKeys : List<PrimaryKeyItem> { }

    public class PrimaryKeyItem
    {
        public string TableSchema { get; set; }
        public string TableName { get; set; }
        public string ColumnName { get; set; }
        public string ConstraintName { get; set; }
    }

    public class ForeignKeyConstraint
    {
        public override string ToString()
        {
            return FKConstraintName;
        }
        public ForeignKeyConstraint()
        {
            Columns = new List<ForeignKeyConstraintColumn>();
        }
        public string FKConstraintName { get; set; }
        public string FKTableName { get; set; }
        public string FKSchemaName { get; set; }
        public string RefTableName { get; set; }
        public string RefConstraintName { get; set; }
        public string RefSchemaName { get; set; }

        public List<ForeignKeyConstraintColumn> Columns { get; set; }
    }
    public class ForeignKeyConstraintColumn
    {
        public string FKColumnName { get; set; }
        public int FKOrdinal { get; set; }
        public string RefColumnName { get; set; }
        public int RefOrdinal { get; set; }
    }
}
